<!DOCTYPE html>
<html>
<!--
  Copyright 2014 Google Inc.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<head>
  <meta charset="utf-8">
  <link href="http://fonts.googleapis.com/css?family=Alegreya:400italic,900italic|Alegreya+Sans:300" rel="stylesheet">
  <link href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css" rel="stylesheet">
  <link href="static/landing.css" rel="stylesheet">
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
  <script src="static/modernizr.custom.14469.js"></script>
  <title>Muzei Live Wallpaper for Android</title>
  <meta name="description" content="Muzei Live Wallpaper for Android. A living museum for your Android home screen.">
  <meta name="viewport" content="width=690">
</head>
<body>

<div id="container">

  <div id="logo"></div>

  <div id="text">
    <p>
      A living museum for your Android home screen.
    </p>
  </div>

  <a id="playlink" href="http://get.muzei.co">&nbsp;</a>

  <div id="device-frame">
    <div id="device-screen">
      <div id="layer-wall-blurred" class="whenartdetailclosed fullscreenlayer"></div>
      <div id="layer-wall" class="whenartdetailopen fullscreenlayer"></div>
      <div id="layer-home" class="whenartdetailclosed fullscreenlayer"></div>
      <div id="layer-artdetail" class="whenartdetailopen">
        <div class="overflow"></div>
        <div class="title"></div>
        <div class="byline"></div>
      </div>
      <div id="layer-sysui" class="fullscreenlayer"></div>
      <svg id="layer-openindicator" width="100" height="100" class="whenartdetailclosed">
        <circle cx="50" cy="50" r="30" fill="#33b5e5" stroke="none">
      </svg>
      <svg>
        <filter id="blur-filter"><feGaussianBlur stdDeviation="20"></filter>
      </svg>
    </div>
    <div id="opentarget" class="whenartdetailclosed"></div>
  </div>

</div>

<script>

if (Modernizr.cssanimations &&
    Modernizr.svg &&
    Modernizr.csstransforms3d &&
    Modernizr.csstransitions) {

  // progressive enhancement
  $('#device-screen').css('display', 'block');
  $('#device-frame').css('background-image', 'url(static/tilted.png)');
  $('#opentarget').css('visibility', 'visible');
  $('body').addClass('withvignette');

  $('#opentarget, #layer-openindicator').click(function() {
    setTimeout(function() {
      $('#device-frame').toggleClass('artdetailopen');
    }, 0);
  });

  $('#device-frame').click(function() {
    if (!$(this).hasClass('artdetailopen')) {
      return;
    }

    $(this).toggleClass('artdetailopen');
  });

  $.ajax({
    dataType: 'jsonp',
    url: 'http://www.muzei.co/featured',
    jsonpCallback: 'withfeatured',
    cache: true,
    success: function(data) {
      var image = data.thumbUri || data.imageUri;
      $('#layer-wall, #layer-wall-blurred').css('background-image', 'url("' + image + '")');
      $('#layer-artdetail .title').text(data.title);
      $('#layer-artdetail .byline').text(data.byline);
    }
  });
}

// Hide additional target for Android to prevent disambig from showing up
if (navigator.userAgent.indexOf('Android') >= 0) {
  $('#opentarget').hide();
}

</script>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-47842763-1', 'muzei.co');
  ga('send', 'pageview');
</script>

</body>
</html>
